package com.prs.crm.action.cqunicom;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.courser.struts.BaseAction;
import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.domain.cqunicom.OrderChart;
import com.prs.crm.domain.cqunicom.OrderChartByMonth;
import com.prs.crm.domain.cqunicom.Services;
import com.prs.crm.domain.cqunicom.ServicesType;
import com.prs.crm.service.cqunicom.OrderChartByMonthService;
import com.prs.crm.service.cqunicom.OrderChartService;

/**
 * @author LanXiaoGang
 * @E-mail:lan9liang@163.com
 * @qq:7857553326
 * @version 创建时间：2011-3-29 下午04:13:48 简单说明
 */

public class OrderChartAction extends BaseAction {

	private static final long serialVersionUID = 1L;

	private PaginationSupport pagination;
	
	private String rowdata;
	
	private String inputV;
	
	private Integer sid;

	private OrderChart orderChart;

	private OrderChartService orderChartService;

	private OrderChartByMonth orderChartByMonth;

	private OrderChartByMonthService orderChartByMonthService;
	
	
	@Action("listOrderChart")
	public String listOrderChart() {

		DetachedCriteria criteria = this.getPaginationHelper().createQuery(OrderChart.class);
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getOrderChartService().listByPage(criteria,
				pagination));
		

		return SUCCESS;
	}
	@Action("listOrderChartByMonth")
	public String listOrderChartByMonth() {

		DetachedCriteria criteria = this.getPaginationHelper().createQuery(OrderChartByMonth.class);
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getOrderChartByMonthService().listByPage(criteria,
				pagination));
		

		return SUCCESS;
	}
	
	@Action(value = "DirtyValue", results = { @Result(name = "success", type = "json", params = {
			"root", "rowdata" }) })
	public String DirtyValue() {

		OrderChartByMonth  orObject=this.getOrderChartByMonthService().get(sid);
		orObject.setMonSJBoNum(Integer.parseInt(inputV));
		this.getOrderChartByMonthService().submit(orObject);


		this.rowdata = "实际拨打量修改成功";
		return SUCCESS;
	}
	
	

	public PaginationSupport getPagination() {
		return pagination;
	}

	public void setPagination(PaginationSupport pagination) {
		this.pagination = pagination;
	}

	public OrderChart getOrderChart() {
		return orderChart;
	}

	public void setOrderChart(OrderChart orderChart) {
		this.orderChart = orderChart;
	}

	public OrderChartService getOrderChartService() {
		return orderChartService;
	}

	public void setOrderChartService(OrderChartService orderChartService) {
		this.orderChartService = orderChartService;
	}

	public OrderChartByMonth getOrderChartByMonth() {
		return orderChartByMonth;
	}

	public void setOrderChartByMonth(OrderChartByMonth orderChartByMonth) {
		this.orderChartByMonth = orderChartByMonth;
	}

	public OrderChartByMonthService getOrderChartByMonthService() {
		return orderChartByMonthService;
	}

	public void setOrderChartByMonthService(
			OrderChartByMonthService orderChartByMonthService) {
		this.orderChartByMonthService = orderChartByMonthService;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	public String getRowdata() {
		return rowdata;
	}
	public void setRowdata(String rowdata) {
		this.rowdata = rowdata;
	}
	public String getInputV() {
		return inputV;
	}
	public void setInputV(String inputV) {
		this.inputV = inputV;
	}
	public Integer getSid() {
		return sid;
	}
	public void setSid(Integer sid) {
		this.sid = sid;
	}

}
